Special FontsTypes of NotesAssembly-Language InformationDevelopment Environment
For More InformationDevice Manager#Introduction to Devices and Drivers$Figure 1-1 Devices and the MacintoshAbout the Device Manager%Figure 1-2 Communication with devicesThe Device Control Entry$Figure 1-3
The device control entry
The Unit TableFigure 1-4
The unit table
The Driver I/O Queue>Figure 1-5
Relationship of the Device Manager data structures
Driver RoutinesFTable 1-1 Device Manager I/O functions and responsible driver routinesDriver Resources)Figure 1-6 Structure of a driver resource
Using the Device Manager0Figure 1-7 Hierarchy of Device Manager functions+Figure 1-8
Device Manager parameter blocks#
Opening and Closing Device Drivers#Listing 1-1 Opening a device driver#Listing 1-2 Closing a device driver!Communicating With Device Drivers(Listing 1-3 Reading from a device driver'Listing 1-4
Writing to a device driver)Controlling and Monitoring Device Drivers7Listing 1-5
Controlling and monitoring a device driver
Writing a Device DriverCreating a Driver ResourceFigure 1-9 The driver header"Listing 1-6
Driver flag constants.Listing 1-7 An assembly-language driver header Responding to the Device Manager)Entering and Exiting From Driver Routines4Listing 1-8 An assembly-language dispatching routineWriting Open and Close Routines(Listing 1-9
Example driver open routine*Listing 1-10
Example driver close routineWriting a Prime Routine*Listing 1-11
Example driver prime routine#Writing Control and Status Routines+Listing 1-12 Example driver control routine*Listing 1-13 Example driver status routine
Handling Asynchronous I/O
Installing a Device DriverTable 1-2 Reserved unit numbers-Listing 1-14
Finding space in the unit table*Writing a Chooser-Compatible Device DriverHow the Chooser WorksFigure 1-10
The Chooser window!Creating a Chooser Extension FileCreating a Device Package)Figure 1-11 Structure of a device packageTable 1-3 Device package flagsResponding to the Chooser -Table 1-4 Chooser messages and their meanings
Allocating Private StorageWriting a Desk AccessoryHow Desk Accessories Work/Creating a Driver Resource for a Desk Accessory%
Opening and Closing a Desk AccessoryResponding to Events
Device Manager ReferenceData StructuresDevice Manager Parameter BlockDevice Control EntryDevice Manager Functions"Opening and Closing Device Drivers
Communicating With Device DriversFSReadPBReadFSWritePBWrite)Controlling and Monitoring Device DriversControl PBControlStatusPBStatusKillIOPBKillIO%Writing and Installing Device Drivers
ResourcesThe Driver Resource$Listing 1-15 'DRVR' resource format
Summary of the Device ManagerSlot ManagerIntroduction to Slots and Cards:Figure 2-1 Simplified processor-bus and NuBus architecture
Slot Address Allocations*Figure 2-2
The NuBus 32-bit address space-Table 2-1 Slot address allocations by slot ID
Firmware
The sResource0Figure 2-3 The structure of a typical sResource -Table 2-2 Large data types used in sResourcesBFigure 2-4 The format of the sBlock and sExecBlock data structuresType and Name Entries&Figure 2-5
The sRsrcType entry format.
The Board sResource and Functional sResources$Figure 2-6
A sample board sResourceThe sResource Directory5Figure 2-7
The structure of the sResource directory The Format BlockBFigure 2-8 The format block and sResources for a sample video card
About the Slot ManagerUsing the Slot Manager#
Enabling and Disabling NuBus Cards!Deleting and Restoring sResources"
Enabling and Disabling sResources/Listing 2-1 Disabling and enabling an sResource
Searching for sResources*Table 2-3 The Slot Manager search routines7Listing 2-2 Searching for a specified type of sResource%Obtaining Information From sResources8Listing 2-3
Searching for the name of a board sResource0
Installing and Removing Slot Interrupt HandlersSlot Manager ReferenceData Structures
Slot Manager Parameter BlockSlot Information Record
Format Header Record
Slot Parameter RAM RecordSlot Execution Parameter BlockSlot Interrupt Queue ElementSlot Manager Routines+Determining the Version of the Slot ManagerSVersionFinding sResources SRsrcInfo SGetSRsrc
SGetTypeSRsrc
SNextSRsrcSNextTypeSRsrc#Getting Information From sResources
SReadDrvrName SReadByte
SReadWord SReadLongSGetCString
SGetBlockSFindStructSReadStruct8
Enabling, Disabling, Deleting, and Restoring sResources
SetSRsrcState
SDeleteSRTRec
InsertSRTRecKTable 2-4 How the Slot Manager determines the base address of a slot device
SUpdateSRT3
Loading Drivers and Executing Code From sResources
SGetDriverSExec?
Getting Information About Expansion Cards and Declaration ROMs SReadInfoSReadFHeader
Summary of the Slot ManagerSCSI ManagerIntroduction to SCSI ConceptsSCSI Bus SignalsTable 3-1 SCSI bus signals
SCSI Bus Phases4Figure 3-1 SCSI bus phases and allowable transitions
SCSI Commands
SCSI MessagesSCSI HandshakingAbout the SCSI Manager(Figure 3-2
The role of the SCSI Manager'Conformance With the SCSI Specification(Overview of SCSI Manager Data Structures
The Structure of Block DevicesThe Driver Descriptor RecordThe Partition MapUsing the SCSI ManagerReading Data From a SCSI Device,Listing 3-1
Reading data from a SCSI deviceUsing CDB and TIB Structures(Listing 3-2 Using TIB and CDB structuresUsing the SCSIComplete Function"Choosing Polled or Blind TransfersSCSI Manager ReferenceData StructuresDriver Descriptor Record
Writing a SCSI Interface Module SIM Initialization and Operation$Supporting the Original SCSI Manager4Table 4-1 Original SCSI Manager parameter conversionHandshaking of Blind TransfersSupporting DMALoading Drivers
SCSI Manager 4.3 ReferenceData StructuresSimple Data TypesDevice Identification RecordCommand Descriptor Block RecordScatter/Gather List Element$
SCSIAction,Table 4-2 SCSIAction function selector codes
SCSINop
SCSIExecIO
SCSIBusInquirySCSIReleaseQSCSIAbortCommandSCSIResetBusSCSIResetDeviceSCSITerminateIOSCSIGetVirtualIDInfoSCSILoadDriverSCSICreateRefNumXrefSCSILookupRefNumXrefSCSIRemoveRefNumXrefSIM Support FunctionsSCSIRegisterBus
Summary of SCSI Manager 4.3ADB ManagerAbout the Apple Desktop BusCharacteristics of ADB DevicesAbout the ADB Manager/Figure 5-1
The ADB Manager and device handlersADB Commands7Figure 5-2 Command formats for Talk, Listen, and Flush 'Figure 5-3 Command format for SendResetADB Transactions$Figure 5-4 A typical ADB transactionADB Device Registers
Register 03Table 5-1 Register 0 in the Apple Standard keyboard
Register 3(Figure 5-5
Format of device register 3 #Table 5-2 Bits in device register 3<Default ADB Device Address and Device Handler Identification.Table 5-3 Defined default ADB device addresses$Table 5-4 Special device handler IDsADB Device Table 4Table 5-5 Typical ADB device table at initializationAddress Resolution'Figure 5-6 Resolving address conflicts ADB CommunicationFigure 5-7 Polling the ADB NFigure 5-8
How an ADB device responds to a polling request by the ADB Manager)Figure 5-9 The ADB service request signal=Figure 5-10
An ADB device asserts the service request signal
Using the ADB ManagerChecking for the ADB Manager%Getting Information About ADB DevicesKListing 5-1 Determining whether an ADB device is an Apple Extended keyboard
Communicating With ADB Devices<Figure 5-11
The ADBOp routine and an ADB completion routine0Listing 5-2 Sending an ADB command synchronously7Listing 5-3 Reading the current state of the LED lights7Listing 5-4 Setting the current state of the LED lights<Listing 5-5 Counting in binary using a keyboard’s LED lightsWriting an ADB Device Handler Installing an ADB Device Handler,Listing 5-6 Installing an ADB device handler6Listing 5-7 Installing a routine pointer into JADBProcCreating an ADB Device Handler$Listing 5-8
A sample device handlerADB Manager ReferenceData StructuresADB Data BlockADB Information BlockADB Operation BlockADB Manager RoutinesInitializing the ADB Manager ADBReInitCommunicating Through the ADBADBOpGetting ADB Device Information CountADBs
Power ManagerAbout the Power Manager.Figure 6-1 A network driver’s sleep dialog boxThe Power-Saver StateThe Idle StateThe Sleep StateThe Sleep Queue
Sleep RequestsJTable 6-1 Response of network services to sleep requests and sleep demands
Sleep DemandsWakeup Demands
Sleep-Request RevocationsPower Manager Dispatch
Using the Power Manager1
Determining Whether the Power Manager Is PresentCDetermining Whether the Power Manager Dispatch Routines are PresentDListing 6-1
Determining which Power Manager dispatch routines exist$Enabling or Disabling the Idle State0Setting, Disabling, and Reading the Wakeup Timer$Listing 6-2 Setting the wakeup timer
Installing a Sleep Procedure.Listing 6-3 Adding an entry to the sleep queue7
Using Application Global Variables in Sleep ProceduresPListing 6-4
Installing a sleep procedure that uses application global variablesWriting a Sleep Procedure1Listing 6-5 Accepting and denying a sleep requestListing 6-6 A sleep procedureCListing 6-7 Retrieving the sleep queue record and the selector codeAListing 6-8 Displaying a dialog box in response to a sleep demand9Listing 6-9 A modal dialog filter function that times out!Switching Serial Power On and Off*Monitoring the Battery and Battery ChargerPower Manager ReferenceData StructuresSleep Queue RecordHard Disk Queue StructureWakeup Time StructureBattery Information StructureBattery Time StructurePower Manager RoutinesControlling the Idle State
IdleUpdate
EnableIdleDisableIdleGetCPUSpeed)
Controlling and Reading the Wakeup Timer SetWUTime
DisableWUTime GetWUTime
Controlling the Sleep Queue
SleepQInstallSleepQRemove
Controlling Serial PowerAOnAOnIgnoreModemBOnAOffBOff(Reading the Status of the Internal ModemModemStatus9Reading the Status of the Battery and the Battery Charger
BatteryStatusPower Manager Dispatch Routines0Determining the Power Manager Features Available
PMSelectorCount
PMFeatures'Controlling the Sleep and Wakeup TimersGetSleepTimeoutSetSleepTimeoutAutoSleepControl IsAutoSlpControlDisabled
GetWakeupTimerSetWakeupTimerControlling the Dimming TimerGetDimmingTimeoutSetDimmingTimeoutDimmingControl IsDimmingControlDisabledControlling the Hard Disk
Getting Information About the Internal BatteriesGetScaledBatteryInfo
BatteryCountGetBatteryVoltage
GetBatteryTimes
Controlling the Internal ModemGetIntModemInfoSetIntModemStateControlling the ProcessorMaximumProcessorSpeedCurrentProcessorSpeedFullProcessorSpeedSetProcessorSpeedIsProcessorCyclingEnabledEnableProcessorCyclingGetting and Setting the SCSI IDGetSCSIDiskModeAddressSetSCSIDiskModeAddress
Application-Defined RoutinesSleep ProceduresMySleepProcHard Disk Spindown FunctionMyHDSpindownProc
Summary of the Power Manager
Serial Driver$Introduction to Serial Communication+
Asynchronous and Synchronous CommunicationDuplex CommunicationFlow Control Methods*Asynchronous Serial Communication Protocol(Figure 7-1 The format of serialized bitsThe RS-422 Serial Interface
About the Serial DriverMacintosh Serial Architecture(Figure 7-2 The role of the Serial DriverSerial Communication ErrorsUsing the Serial Driver#Listing 7-1 Using the Serial Driver
Opening the Serial Driver$Specifying an Alternate Input BufferSetting the Handshaking Options%Setting the Baud Rate and Data Format'Reading and Writing to the Serial Ports
Synchronous I/O RequestsAsynchronous I/O RequestsClosing the Serial Driver